feat(ui): dark/light mode toggle with system preference detection#523
Merged
Tinna23 merged 1 commit intoJun 21, 2026
Merged
Conversation
…StellarCommons#513) - Add CSS custom properties for dark (default) and light themes in globals.css - Create useTheme hook: reads localStorage, falls back to prefers-color-scheme - Create ThemeToggle component (sun/moon icon button) for AppShell and Navbar - Add FOUC-prevention inline script to layout.tsx - Convert all hardcoded colors to CSS vars in: AppShell, Card, Pill, Label, AddressChip, SearchBar, TabSwitcher, TransactionResult, AccountResult - Update landing page (Navbar, HeroSection, page.tsx) to use CSS vars - Fix 3 pre-existing TS errors in UseCasesSection.tsx - Add missing eslint-config-prettier dependency
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #513
Summary
Adds a full theme system to Stellar Explain, converting all hardcoded colors to CSS custom properties and adding a toggle button that persists across page reloads.
Changes
New files:
src/hooks/useTheme.ts— reads localStorage, falls back toprefers-color-scheme, syncsdata-themeattributesrc/components/ThemeToggle.tsx— sun/moon icon button with CSS var stylingModified files:
src/app/globals.css— full dark (default) + light token set as CSS custom propertiessrc/app/layout.tsx— inline FOUC-prevention script on<html>src/components/AppShell.tsx— CSS vars throughout + ThemeToggle in headersrc/components/Card.tsx,Pill.tsx,Label.tsx,AddressChip.tsx— all CSS varssrc/components/SearchBar.tsx,TabSwitcher.tsx— all CSS varssrc/components/TransactionResult.tsx,AccountResult.tsx— all CSS varssrc/components/landing/Navbar.tsx,HeroSection.tsx,src/app/page.tsx— CSS vars + ThemeToggle in NavbarBug fixes (pre-existing):
UseCasesSection.tsx(entryanddpossibly undefined)eslint-config-prettierdependency (build was broken on main)Acceptance Criteria
<head>)transition: background-color 0.2s easeonhtml)npm run buildpasses)